<?php
include_once 'php/connection.php';
session_start();

$name=$_POST['uname'];
$password=$_POST['paswd'];

$sql="select * from registration where Email='$name' and password='$password' and type_of_registration = 'admin'";
if(!$result=mysql_query($sql))
{
echo mysql_error();
 
}
else
{
echo mysql_num_rows($result);
if(mysql_num_rows($result) > 0)
{
 $_SESSION['nenunnanu_admin']=$name;
 $row = mysql_fetch_array($result);
 $_SESSION['nenunnanu_id'] = $row['id'];
    header("location:add_article.php");
   
}
   else
   {
    header("location:admin_login.php?status=failed");
    
   }
   
}
?>